<!DOCTYPE html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>Simple context menu</title>
</head>

<script type="text/javascript" src="../common/dhtmlxSuite/dhtmlx.js"></script>
<script type="text/javascript" src="../common/dhtmlxSuite/dhtmlx_deprecated.js"></script>
<script src="../../codebase/dhtmlxgantt.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="../../codebase/dhtmlxgantt.css" type="text/css" media="screen" title="no title" charset="utf-8">


<link rel="stylesheet" href="../common/dhtmlxSuite/skins/terrace/dhtmlx.css" type="text/css" media="screen" title="no title" charset="utf-8">

<script type="text/javascript" src="../common/testdata.js"></script>
<style type="text/css">
	html, body{ height:100%; padding:0px; margin:0px; overflow: hidden;}

</style>
<body>
<div id="gantt_here" style='width:100%; height:100%'></div>
<div id="context"></div>
<script type="text/javascript">

	gantt.init("gantt_here");
	gantt.parse(demo_tasks);

	var menu = new dhtmlXMenuObject();
	menu.setIconsPath("../common/sample_images/");
	menu.renderAsContextMenu();
	menu.setSkin("dhx_terrace");
	menu.loadXML("../common/dhxmenu.xml");

	gantt.attachEvent("onContextMenu", function(taskId, linkId, event){
		var x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft,
			y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;

		if(taskId){
			menu.showContextMenu(x, y);
		}else if(linkId){
			menu.showContextMenu(x, y);
		}

		if(taskId || linkId){
			return false;
		}

		return true;
	});


</script>
</body>